/*
Contains:
	the monster declarations
	the hit dice per monster
	the inherited procs from /mob
	an overrided New() proc
*/

monster
	parent_type = /mob

	icon = 'monk.dmi'
	icon_state = "temp"

	alliance = MONSTER

	death(mob/killer, respawn)
		if(respawn) make_new_monster(type, x, y, z, SPAWN_DELAY)
		if(isplayer(killer))
			var/player/p = killer
			p.determine_exp_gain(level)
		del src

	attack(mob/m)

		dir = get_dir(src, m)

		var/x = roll(hit_die)
		if(x == 20)
			x = (roll(dam_die)*3)+attack_bonus
			//TODO: <0 = block, or miss shows miss
			if(x>0)
				m.take_damage(src, x, "#ff0000")

		else if(x+bonus > m.ac)
			x = roll(dam_die)+attack_bonus
			if(x>0)
				m.take_damage(src, x, "#ff0000")

	New()
		..()
		var/x = min(level * 30, ((level ** 1.3)*2)+30)
		hp = new /restricted(0, x, x)
		spawn(rand(10,40)) ai()